// DNT

extends /templates/core/modal-base-flat

block modal-header-content
  h3 Save Branch

block modal-body-content
  .container-fluid
    .row
      .col-sm-2
        #branches-list-group.list-group
          a.list-group-item(class=(view.selectedBranch ? '' : 'active'))
            i New Branch
            input#new-branch-name-input.form-control(placeholder='Name')
          for branch in view.branches.models
            a.list-group-item(data-branch-cid=branch.cid class=(view.selectedBranch == branch ? 'active': ''))
              span.delete-branch-btn.glyphicon.glyphicon-remove.pull-right
              = branch.get('name')
              div.small
                i= branch.get('updatedByName')
                br
                span= moment(branch.get('updated')).format('lll')
            
      .col-sm-5
        h2 Changes from Prod
        each component in view.componentsWithChanges.models
          h4.checkbox
            label
              input.component-checkbox(type="checkbox", data-component-id=component.id, checked=true)
              =" "
              | Component: #{component.get('system')}.#{component.get('name')}
          .component-changes-stub(data-component-id=component.id)
          
          
        each system in view.systemsWithChanges.models
          h4.checkbox
            label
              input.system-checkbox(type="checkbox", data-system-id=system.id, checked=true)
              =" "
              | System: #{system.get('name')}
          .system-changes-stub(data-system-id=system.id)

      .col-sm-5#selected-branch-col
        if view.selectedBranch
          h2 Changes from Branch
          each component in view.selectedBranch.components.models
            h4 Component: #{component.get('system')}.#{component.get('name')}
            .component-changes-stub(data-component-id=component.id)

          each system in view.selectedBranch.systems.models
            h4 System: #{system.get('name')}
            .system-changes-stub(data-system-id=system.id)
          
        else
          h2 New Branch
          
            

block modal-footer-content
  button#stash-branch-btn.btn.btn-primary Stash Branch
  button#save-branch-btn.btn.btn-primary Save Branch
